<?php

/**
 * ParametruApartament form base class.
 *
 * @method ParametruApartament getObject() Returns the current form's model object
 *
 * @package    acap
 * @subpackage form
 * @author     Verminu
 */
abstract class BaseParametruApartamentForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'            => new sfWidgetFormInputHidden(),
      'luna'          => new sfWidgetFormInputText(),
      'apartament_id' => new sfWidgetFormPropelChoice(array('model' => 'Apartament', 'add_empty' => false)),
      'criteriu_id'   => new sfWidgetFormPropelChoice(array('model' => 'Criteriu', 'add_empty' => false)),
      'valoare'       => new sfWidgetFormInputText(),
      'created_at'    => new sfWidgetFormDateTime(),
      'updated_at'    => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'            => new sfValidatorChoice(array('choices' => array($this->getObject()->getId()), 'empty_value' => $this->getObject()->getId(), 'required' => false)),
      'luna'          => new sfValidatorInteger(array('min' => -32768, 'max' => 32767)),
      'apartament_id' => new sfValidatorPropelChoice(array('model' => 'Apartament', 'column' => 'id')),
      'criteriu_id'   => new sfValidatorPropelChoice(array('model' => 'Criteriu', 'column' => 'id')),
      'valoare'       => new sfValidatorNumber(),
      'created_at'    => new sfValidatorDateTime(array('required' => false)),
      'updated_at'    => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('parametru_apartament[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'ParametruApartament';
  }


}
